EMT Practice Test

1. Question Content...


Question List

Question1: A software company uses the following objects and relationships:
* Case: to handle customer support issues
* Defect_c: a custom object to represent known issues with the company's software
* case_Defect__c: a junction object between Case and Defector to represent that a defect Is a customer issue What should be done to share a specific Case-Defect_c record with a user?

Question2: A Lightning component has a wired property, searchResults, that stores a list of Opportunities. Which definition of the Apex method, to which the searchResults property is wired, should be used?

Question3: Considering the following code snippet:

When the code executes a DML exception is thrown.
How should the developer modify the code to ensure exceptions are handled gracefully?

Question4: What are two use cases for executing Anonymous Apex code? Choose 2 answers

Question5: A developer needs to implement a custom SOAP Web Service that is used by an external Web Application. The developer chooses to Include helper methods that are not used by the Web Application In the Implementation of the Web Service Class.
Which code segment shows the correct declaration of the class and methods?
A)

B)

C)

D)

Question6: When a user edits the Postal Code on an Account, a custom Account text field named "Timezone" must be update based on the values in a PostalCodeToTimezone__c custom object. How should a developer implement this feature?

Question7: What are three techniques that a developer can use to invoke an anonymous block of code? (Choose three.)

Question8: A team of many developers work in their own individual orgs that have the same configuration at the production org. Which type of org is best suited for this scenario?

Question9: A Visual Flow uses an apex Action to provide additional information about multiple Contacts, stored in a custom class, contactInfo. Which is the correct definition of the Apex method that gets additional information?

Question10: A developer created a custom order management app that uses an Apex class. The order is represented by an Order object and an Orderltem object that has a master-detail relationship to Order. During order processing, an order may be split into multiple orders.
What should a developer do to allow their code to move some existing Orderltem records to a new Order record?

Question11: What is the maximum number of SOQL queries used by the following code? List<Account> aList = [SELECT Id FROM Account LIMIT 5]; for (Account a : aList){ List<Contact> cList = [SELECT Id FROM Contact WHERE AccountId = :a.Id); }

Question12: Which exception type cannot be caught ?

Question13: While writing a test class that covers an OpportunityLineItem trigger, a Developer is unable to create a standard PriceBook since one already exists in the org.
How should the Developer overcome this problem?

Question14: A developer created a Lightning web component called statusComponent to be inserted into the Account record page.
Which two things should the developer do to make the component available?

Question15: A developer created a Visualforce page and custom controller to display the account type field as shown below. Custom controller code: public class customCtrlr{ private Account theAccount; public String actType; public customCtrlr() { theAccount = [SELECT Id, Type FROM Account WHERE Id = :apexPages.currentPage().getParameters().get('id')]; actType = theAccount.Type; } } Visualforce page snippet: The Account Type is {!actType} The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is property referenced on the Visualforce page, what should the developer do to correct the problem?

Question16: A developer needs to join data received from an integration with an external system with parent records in Salesforce. The data set does not contain the Salesforce IDs of the parent records, but it does have a foreign key attribute that can be used to identify the parent.
Which action will allow the developer to relate records in the data model without knowing the Salesforce ID?

Question17: A developer Is asked to create a Visualforce page that lists the contacts owned by the current user. This component will be embedded In a Lightning page.
Without writing unnecessary code, which controller should be used for this purpose?

Question18: A developer needs an Apex method that can process Account or Contact records. Which method signature should the developer use?

Question19: An Opportunity needs to have an amount rolled up from a custom object that is not in a master-detail relationship.
How can this be achieved?

Question20: Refer to the following code snippet for an environment has more than 200 Accounts belonging to the Technology' industry:

When the code execution, which two events occur as a result of the Apex transaction?
When the code executes, which two events occur as a result of the Apex transaction?
Choose 2 answers

Question21: Which annotation exposes an Apex class as a RESTful web service?

Question22: Which statement is true about developing in a multi-tenant environment?

Question23: What are two characteristics related to formulas? Choose 2 answers.

Question24: As part of a data cleanup strategy, AW Computing wants to proactively delete associated opportunity records when the related Account is deleted.
Which automation tool should be used to meet this business requirement?

Question25: What are three characteristics of change set deployments?
Choose 3 answers

Question26: A developer created these three Rollup Summary fields in the custom object, Project_ct,

The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project.
Which should the developer use to Implement the business requirement in order to minimize maintenance overhead?

Question27: A developer created a child Lightning web component nested inside a parent Lightning web component, parent component needs to pass a string value to the child component.
In which two ways can this be accomplished?
Choose 2 answers

Question28: What should a developer use to script the deployment and unit test execution as part of continuous integration?

Question29: Universal Containers wants to assess the advantages of declarative development versus programmatic customization for specific use cases in its Salesforce implementation.
What are two characteristics of declarative development over programmatic customization?
Choose 2 answers

Question30: Universal Container use a simple order Management app. On the Order Lines, the order line total is calculated by multiplying the item price with the quantity ordered. There is a Master-Detail relationship between the Order and the Order Lines object.
What is the practice to get the sum of all order line totals on the order header?

Question31: What are two benefits of using declarative customizations over code? Choose 2 answers What are two benefits of using declarative customizations over code?

Question32: A developer is migrating a Visualforce page into a Lightning web component.
The Visualforce page shows information about a single record. The developer decides to use Lightning Data Service to access record data.
Which security consideration should the developer be aware of?

Question33: Which two are best practices when it comes to component and application event handling? (Choose two.)

Question34: A Licensed_Professional__c custom object exist in the system with two Master-Detail fields for the following objects: Certification__c and Contact. Users with the "Certification Representative" role can access the Certification records they own and view the related Licensed Professionals records, however users with the "Salesforce representative" role report they cannot view any Licensed professional records even though they own the associated Contact record. What are two likely causes of users in the "Sales Representative" role not being able to access the Licensed Professional records? Choose 2 answers

Question35: A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple subjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL.
Which three statements are useful inside the unit test to effectively test the custom controller?
Choose 3 answers

Question36: Universal Container is building a recruiting app with an Applicant object that stores information about an individual person that represents a job. Each application may apply for more than one job.
What should a developer implement to represent that an applicant has applied for a job?

Question37: Given the following trigger implementation:
trigger leadTrigger on Lead (before update){
final ID BUSINESS_RECORDTYPEID = '012500000009Qad';
for(Lead thisLead : Trigger.new){
if(thisLead.Company != null && thisLead.RecordTypeId != BUSINESS_RECORDTYPEID){ thisLead.RecordTypeId = BUSINESS_RECORDTYPEID;
}
}
}
The developer receives deployment errors every time a deployment is attempted from Sandbox to Production.
What should the developer do to ensure a successful deployment?

Question38: A developer wrote the following two classes:

The StatusFetcher class successfully compiled and saved. However, the Calculator class has a compile time error.
How should the developer fix this code?

Question39: What should a developer do to check the code coverage of a class after running all tests?

Question40: Which three statements are true regarding trace flags? (Choose three.)

Question41: What are two ways for a developer to execute tests in an org?

Question42: What will be the output in the debug log in the event of a QueryExeption during a call to the @query method in the following Example?

Question43: What is the result of the following code snippet?

Question44: What are three ways for a developer to execute tests in an org? Choose 3.

Question45: A developer writes a trigger on the Account object on the before update event that increments a count field. A workflow rule also increments the count field every time that an Account is created or update. The field update in the workflow rule is configured to not re-evaluate workflow rules. What is the value of the count field if an Account is inserted with an initial value of zero, assuming no other automation logic is implemented on the Account?

Question46: Given the following code snippet, that is part of a custom controller for a Visualforce page:

In which two ways can the try/catch be enclosed to enforce object and field-level permissions and prevent the DML statement from being executed if the current logged-in user does not have the appropriate level of access? Choose 2 answers

Question47: Universal Containers stores Orders and Line Items in Salesforce. For security reason, financial representatives are allowed to see information on the Order such as order amount, but they are not allowed to see the Line items on the Order. Which type of relationship should be used?

Question48: A developer wants to retrieve the Contacts and Users with the email address '[email protected]'.
Which SOSL statement should the developer use?

Question49: How should a custom user interface be provided when a user edits an Account in Lightning Experience?

Question50: Universal Containers wants Opportunities to be locked from editing when reaching the Closed/Won stage.
Which two strategies should a developer use to accomplish this? Choose 2 answers

Question51: A developer has a requirement to create an Order When an Opportunity reaches a "Closed-Won" status.
Which tool should be used to implement this requirement?

Question52: A developer must build application that tracks which Accounts have purchase specific pieces of equal products. Each Account could purchase many pieces of equipment.
How should the developer track that an Account has purchased a piece of equipment.

Question53: Which two statements accurately represent the MVC framework implementation in Salesforce? Choose 2 answers

Question54: A developer must write an Apex method that will be called from a Lightning component. The method may delete an Account stored in the accountRecvariable.
Which method should a developer use to ensure only users that should be able to delete Accounts can successfully perform deletions?

Question55: In terms of the MVC paradigm, what are two advantages of implementing the layer of a Salesforce application using Aura Component-based development over Visualforce? Choose 2 answers

Question56: Which two statements are true about using the @testSetup annotation in an Apex test class?
Choose 2 answers

Question57: A developer observes that an Apex test method fails in the Sandbox. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous tool in the Developer Console. The code then executes with no exceptions or errors. Why did the test method fail in the sandbox and pass in the Developer Console?

Question58: AW Computing (AWC) handles orders In Salesforce and stores Its product Inventory In a fter, inventory__c, on a custom object, Product__c. When en order for a Product__c Is placed, the inventory__c field Is reduced by the quantity of the order using an Apex trigger.

AWC wants the real-time inventory reduction for a product to be sent to many of Its external systems, Including some future systems the company Is currently planning.
What should a developer add to the code at the placeholder to meet these requirements?
A)

B)

C)

D)

Question59: Which three operations affect the number of times a trigger can fire?
Choose 3 answers

Question60: What is an example of a polymorphic lookup field in Salesforce?

Question61: Which three Salesforce resources can be accessed from a Lightning web component?
Choose 3 answers

Question62: Assuming that 'name; is a String obtained by an <apex:inputText> tag on a Visualforce page. Which two SOQL queries performed are safe from SOQL injections? Choose 2 answers

Question63: An org tracks customer orders on an Order object and the items of an Order on the Line Item object. The Line Item object has a MasterDetail relationship to the order object. A developer has a requirement to calculate the order amount on an Order and the line amount on each Line item based on quantity and price.
What is the correct implementation?

Question64: Which two are phases in the Aura application event propagation framework? Choose 2 answers

Question65: A developer has a Visualforce page and custom controller to save Account records. The developer wants to display any validation rule violation to the user. How can the developer make sure that validation rule violations are displayed?

Question66: Which process automation should be used to send an outbound message without using Apex code?

Question67: Universal Containers has an order system that uses an Order Number to identify an order for customers and service agents. Order will be imported into Salesforce.

Question68: A developer needs to save a List of existing Account records named myAccounts to the database, but the records do not contain Salesforce Id values. Only the value of a custom text field configured as an External ID with an API name of Foreign_Key__c is known.
Which two statements enable the developer to save the records to the database without an Id? (Choose two.)

Question69: A workflow updates the value of a custom field for an existing Account.
How can a developer access the updated custom field value from a trigger?

Question70: What does the Lightning Component framework provide to developers?

Question71: Which declarative process automation feature supports iterating over multiple records?

Question72: A developer identifies the following triggers on the Expense_c object:
DeleteExpense,
applyDefaultstoexpense
validateexpenseupdate;
The triggers process before delete, before insert, and before update events respectively.
Which two techniques should the developer implement to ensure trigger best practice are followed?

Question73: The Salesforce Administrator created a custom picklist field, Account_status_c, on the a Account object. This picklist has possible values of Inactive'' and Active?
As part of a new business process, management wants to ensure an opportunity record is created only for Accounts marked as "Active". A developer is asked to implement this business requirement.
Which two automation tools should be used to fulfill the business need?
Choose 2 answers

Question74: A develop completed modification to a customized feature that is comprised of two elements:
Apex trigger
Trigger handler Apex class
What are two factors that the developer must take into account to properly deploy the modification to the production environment?

Question75: What is the order of operations when a record is saved in Salesforce?

Question76: A developer needs to confirm that an Account trigger is working correctly without changing the organization's data.What would the developer do to test the Account trigger?

Question77: Universal Containers decides to use purely declarative development to build out a new Salesforce application.
Which three options can be used to build out the business logic layer for this application?
Choose 3 answers

Question78: Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records. which Visualforce feature supports this requirement?

Question79: AW Computing tracks order information in custom objects called order__c and order_Line_ c - Currently, all shipping information is stored in the order__c object.
The company wants to expand Its order application to support split shipments so that any number of order_Line__c records on a single order__c can be shipped to different locations.
What should a developer add to fulfill this requirement?

Question80: What are two ways a developer can get the status of an enquered job for a class that queueable interface? Choose 2 answers

Question81: A developer needs to create a custom Interface in Apex.
Which three considerations must the developer keep in mind while developing the Apex Interface?
Choose 3 answers

Question82: Which statement generates a list of Leads and Contacts that have a field with the phrase 'ACME'?

Question83: A developer must create a ShippingCalculator class that cannot be instantiated and must include a working default implementation of a calculate method, that sub-classes can override.
What is the correct implementation of the ShippingCalculator class?

Question84: What are three considerations when using the @InvocableMethod annotation in Apex?
Choose 3 answers

Question85: A developer has the following requirements:
Calculate the total amount on an Order.
Calculate the line amount for each Line Item based on quantity selected and price.
Move Line Items to a different Order if a Line Item is not stock.
Which relationship implementation supports these requirements?

Question86: A developer is debugging the following code to determinate why Accounts are not being created Account a = new Account(Name = 'A'); Database.insert(a, false); How should the code be altered to help debug the issue?

Question87: A Salesforce developer wants to review their code changes immediately and does not want to install anything on their computer or on the org.
Which tool is best suited?

Question88: The Job_Application__c custom object has a field that is a Master-Detail relationship to the Contact object, where the Contact object is the Master. As part of a feature implementation, a developer needs to retrieve a list containing all Contact records where the related Account Industry is 'Technology' while also retrieving the contact's Job_Application__c records.
Based on the object's relationships, what is the most efficient statement to retrieve the list of contacts?

Question89: Application Events follow the traditional publish-subscribe model. Which method is used to fire an event?

Question90: A developer is building custom search functionality that uses SOSL to search account and contact records that match search terms provided by the end user. The feature is exposed through a Lightning web component, and the end user is able to provide a list of terms to search.
Consider the following code snippet:

What is the maximum number of search terms the end user can provide to successfully execute the search without exceeding a governor limit?

Question91: A developer needs to update an unrelated object when a record gets saved. Which two trigger types should the developer create?

Question92: An after trigger on the Account object performs a DML update operation on all of the child Opportunities of an Account. There are no active triggers on the Opportunity object, yet a "maximum trigger depth exceeded" error occurs in certain situations.
Which two reasons possibly explain the Account trigger firing recursively? (Choose two.)

Question93: The following code snippet is executed by a Lightning web component in an environment with more than 2,000 lead records:

Which governor limit will likely be exceeded within the Apex transaction?